﻿using Domain.Entities;
using FrameworkCore.Attributes;
using System.ComponentModel.DataAnnotations;

namespace AiBLSmartEdu.Module.Cust.API.DTOs;

#nullable disable

/// <summary>
/// 创建用户模型
/// </summary>
[Map(typeof(Customer))]
public class CustomerCreateInputModel
{
    /// <summary>
    /// 用户名
    /// </summary>
    [Required(ErrorMessage = "用户名是必填项")]
    public string Username { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [Required(ErrorMessage = "邮箱是必填项")]
    [EmailAddress(ErrorMessage = "无效的邮箱地址")]
    public string Email { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    [Required(ErrorMessage = "密码是必填项")]
    [MinLength(6, ErrorMessage = "密码长度必须至少为6个字符")]
    public string Password { get; set; }

    /// <summary>
    /// 确认密码
    /// </summary>
    [Required(ErrorMessage = "确认密码是必填项")]
    [Compare(nameof(Password), ErrorMessage = "密码和确认密码不匹配")]
    public string ConfirmPassword { get; set; }
}
